const router = require('koa-router')();
const {db,} = require("../../models/db");

router.post('/contact/transContact', async ctx => {
    let from = ctx.request.body.formData.fromId
    let to = ctx.request.body.formData.toId
    let tenantId = ctx.user.tenantId
    if(from && to) {
        await db.query(`update contact set salesId=${to} where salesId=${from} and tenantId=${tenantId}`)
    } else {
        return ctx.err('未知业务员')
    }
    ctx.suc('转移成功')
})



module.exports = router;